# -*- coding: utf-8 -*-
# @Time    : 2019/3/12 7:36
# @Author  : Roger Lee
# @Email   : 704482843@qq.com
# @File    : main.py
# @Software: PyCharm

from . utils import getSignature, get_g_sign


class Cookie:

    def __init__(self, partnerCode="123", platform='2', version="3.1.0"):
        self.partnerCode = partnerCode
        self.platform = platform
        self.version = version

    def get(self, value):
        if value == "CoreSessionId":
            return getSignature(partnerCode=self.partnerCode, platform=self.platform)

        elif value == "_g_sign":
            s = getSignature(partnerCode=self.partnerCode, platform=self.platform)
            return get_g_sign(str(s))

